/*
 * aqua-firefox-theme
 * dark.css
 *
 * Copyright (c) 2019 Payson Wallach
 *
 * Released under the terms of the GNU General Public License, version 3
 * (https://gnu.org/licenses/gpl.html)
 */

@namespace xul url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");

/*
 * Variables prepended with `aqua` are unique to the theme and are assigned
 * to elements elsewhere. All other variables are defined by Firefox, and thus
 * must be overridden with `!important` to be changed.
 */

@media (prefers-color-scheme: dark) {
  :root {
    /* browser area before a page starts loading */
    --aqua-browser-before-load-background: #333333;

    /* toolbars */
    --aqua-toolbar-background: #373737;
    --aqua-tabstoolbar-background: #1e1e1e;
    --aqua-findbar-background: #333333;
    --aqua-toolbar-color: #ffffff;
    --aqua-toolbar-border-color: #202020;
    --aqua-inactive-toolbar-background: #353535;
    --aqua-inactive-toolbar-border-color: #121212;

    /* sidebar */
    --aqua-sidebar-background: #3b3b3b;
    --aqua-inactive-sidebar-background: #3f3f3f;

    /* popups */
    --aqua-menu-background: #333333;
    --aqua-menu-border-color: #202020;
    --aqua-popover-background: #333333;
    --aqua-popover-border-color: #202020;
    --aqua-popover-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --aqua-popover-button-hover-background: rgba(255, 255, 255, 0.1);
    --aqua-popover-button-active-background: rgba(255, 255, 255, 0.15);
    --aqua-popover-separator-color: rgba(0, 0, 0, 0.1);

    /* header bar */
    --aqua-headerbar-background: linear-gradient(to top, #383838 0%, #3e3e3e 50%, #434343 100%);
    --aqua-headerbar-border-color: #202020;
    --aqua-headerbar-box-shadow: inset 0 1px rgba(255, 255, 255, 0.15);
    --aqua-inactive-headerbar-background: linear-gradient(#313131, #313131);
    --aqua-inactive-headerbar-border-color: #202020;
    --aqua-inactive-headerbar-box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);

    /* buttons */
    --aqua-button-background: linear-gradient(to top, #636363 0%, #696969 100%);
    --aqua-button-border-color: #282828;
    --aqua-button-border-accent-color: #282828;
    --aqua-headerbar-button-border-color: #323232;
    --aqua-headerbar-button-border-accent-color: #303030;
    --aqua-button-box-shadow: inset 0 1px rgba(255, 255, 255, 0.1);
    --aqua-button-hover-color: rgba(255, 255, 255, 0.1);
    --aqua-button-active-color: rgba(255, 255, 255, 0.2);
    --aqua-button-hover-background: linear-gradient(to top, #727272 0%, #757575 100%);
    --aqua-button-active-background: linear-gradient(#1e1e1e, #1e1e1e);
    --aqua-button-active-border-color: #1b1b1b;
    --aqua-button-active-border-accent-color: #1b1b1b;
    --aqua-button-active-box-shadow: inset 0 1px rgba(255, 255, 255, 0.03);
    --aqua-button-disabled-background: #505050;
    --aqua-button-disabled-border-color: #323232;
    --aqua-button-disabled-box-shadow: inset 0 1px rgba(255, 255, 255, 0.03);
    --aqua-inactive-button-background: linear-gradient(#383838, #383838);
    --aqua-inactive-button-border-color: #323232;
    --aqua-inactive-button-box-shadow: inset 0 1px rgba(255, 255, 255, 0.0);
    --aqua-button-suggested-action-background: linear-gradient(to top, #155099 2px, #15539e);
    --aqua-button-suggested-action-border-color: #0f3b71;
    --aqua-button-suggested-action-border-accent-color: #092444;
    ;
    --aqua-button-suggested-action-box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
    --aqua-button-suggested-action-hover-background: linear-gradient(to top, #155099, #1655a2 1px);
    --aqua-button-suggested-action-active-background: #103e75;
    --aqua-button-suggested-action-active-border-color: #0f3b71;
    --aqua-button-suggested-action-active-box-shadow: inset 0 1px rgba(255, 255, 255, 0.05);
    --aqua-button-destructive-action-background: linear-gradient(to top, #ae151c 2px, #b2161d);
    --aqua-button-destructive-action-border-color: #851015;
    --aqua-button-destructive-action-border-accent-color: #570b0e;
    --aqua-button-destructive-action-box-shadow: inset 0 1px rgba(255, 255, 255, 0.02), 0 1px 2px rgba(0, 0, 0, 0.07);
    --aqua-button-destructive-action-hover-background: linear-gradient(to top, #ae151c, #b7161d 1px);
    --aqua-button-destructive-action-active-background: #8a1116;
    --aqua-button-destructive-action-active-border-color: #851015;
    --aqua-button-destructive-action-active-box-shadow: inset 0 1px rgba(255, 255, 255, 0);

    /* URL bar */
    --aqua-urlbar-background: linear-gradient(#2d2d2d, #2d2d2d);
    --aqua-urlbar-border-color: #282828;
    --aqua-urlbar-box-shadow: inset 0 0 0 1px rgba(21, 83, 158, 0);
    --aqua-urlbar-color: #ffffff;
    --aqua-inactive-urlbar-background: linear-gradient(#303030, #303030);
    --aqua-inactive-urlbar-border-color: #282828;
    --aqua-inactive-urlbar-box-shadow: none;
    --aqua-inactive-urlbar-color: #d6d6d6;
    --aqua-focused-urlbar-border-color: #15539e;
    --aqua-private-urlbar-background: #25003e;

    /* tab bar */
    --aqua-tab-border-color: #202020;
    --aqua-tab-separator-color: #4f5050;
    --aqua-tab-background: #262626;
    --aqua-tab-color: rgb(141, 144, 145);
    --aqua-tab-hover-background: #2b2b2b;
    --aqua-tab-hover-border-bottom-color: #1b1b1b;
    --aqua-tab-hover-color: rgb(200, 200, 200);
    --aqua-tab-active-background: #2e2e2e;
    --aqua-tab-active-color: #ffffff;
    --aqua-tab-active-hover-background: #313131;
    --aqua-inactive-tab-color: rgb(141, 144, 145);
    --aqua-inactive-tab-active-background: #353535;
    --aqua-inactive-tab-active-color: rgb(141, 144, 145);
    --aqua-tab-close-icon: url("");

    /*
     * Dirty hacks for replaced symbolic icons
     *
     * Icons are loaded from `/usr/share/icons/<theme>` and for some themes need
     * to be inverted or otherwise adjusted. Use the filters below to your
     * needs (you may also adjust icon brightness here).
     */
    --aqua-convert-icon-to-symbolic-hack-filter: invert(100%) sepia(100%) grayscale(100%) brightness(200%) brightness(85%);
    --aqua-icons-hack-filter: invert(100%) sepia(100%) grayscale(100%) brightness(200%) brightness(200%);
    /* without invert: none */
    --aqua-window-icons-hack-filter: invert(90%);
    /* without invert: none */
  }
}
